package viz.model.flare.data
{
	import com.adobe.utils.ArrayUtil;
	
	import mx.collections.ArrayCollection;
	import mx.events.CollectionEvent;
	import mx.events.PropertyChangeEvent;
	import mx.events.PropertyChangeEventKind;
	
	import viz.model.IDecodeable;
	import viz.model.flare.data.StateItem;

	public class StateMap extends ArrayCollection implements IDecodeable
	{
		private var initialChangeFlag:Boolean;
		
		public function StateMap(source:Array=null)
		{
			super(source);
			
		}
		
		public function get packagelist():Array{
			var a:Array = [];
			for each (var state:StateItem in this ){
				if(!ArrayUtil.arrayContainsValue( a, state.pkg ))a.push(state.pkg)
			}
			return a;
		}
		
		public function decode():Object{
			var a:Array = [],
				state:StateItem;
			for each (state in this){
				a.push( state.decode() );
			}
			return a;
		}
		
		
		
		
		
		
	}
}